const home = r => require.ensure([], () => r(require('../pages/home/index')), 'home')
const homeTaskList = r => require.ensure([], () => r(require('../pages/home/task-list')), 'homeTaskList')
const homeTaskDeatil = r => require.ensure([], () => r(require('../pages/home/task-detail')), 'homeTaskDeatil')
const job = r => require.ensure([], () => r(require('../pages/job')), 'job')
const login = r => require.ensure([], () => r(require('../pages/login')), 'login')

const mine = r => require.ensure([], () => r(require('../pages/mine')), 'mine')
const mineChildren = r => require.ensure([], () => r(require('../pages/mine-children/index.vue')), 'mineChildren')
const myInfo= r => require.ensure([], () => r(require('../pages/mine-children/my-info')), 'myInfo')
const userInfo = r => require.ensure([], () => r(require('../pages/mine-children/user-info')), 'userInfo')

const manageMyInfo = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/index.vue')), 'manageMyInfo')

const workAndSkills = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/workAndSkills')), 'workAndSkills')
const addTheWork = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/addTheWork')), 'addTheWork')
const addSkills = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/addSkills')), 'addSkills')
const workExperience = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/workExperience')), 'workExperience')
const educationBackground = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/educationBackground')), 'educationBackground')
const educations = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/educations')), 'educations')
const preferences = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/preferences')), 'preferences')
const managementWork = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/managementWork')), 'managementWork')
const managementSkills = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/managementSkills')), 'managementSkills')
const addWorkExperience = r => require.ensure([], () => r(require('../pages/mine-children/manage-my-info/addWorkExperience')), 'addWorkExperience')


const release = r => require.ensure([], () => r(require('../pages/release')), 'release')
const messageDetails = r => require.ensure([], () => r(require('../components/message-details')), 'messageDetails')

const message = r => require.ensure([], () => r(require('../pages/message')), 'message')
const authentication = r => require.ensure([], () => r(require('../pages/mine-children/authentication')), 'authentication')


const publicChildren= r => require.ensure([], () => r(require('../pages/public/index.vue')), 'publicChildren')
const feedback = r => require.ensure([], () => r(require('../pages/public/feedback.vue')), 'feedback')
const historyRelease = r => require.ensure([], () => r(require('../pages/public/history-release.vue')), 'historyRelease')
const myBill = r => require.ensure([], () => r(require('../pages/public/my-bill.vue')), 'myBill')
const myWallet = r => require.ensure([], () => r(require('../pages/public/my-wallet.vue')), 'myWallet')
const editingTasks = r => require.ensure([], () => r(require('../pages/public/editing-tasks.vue')), 'editingTasks')
const registrationList = r => require.ensure([], () => r(require('../pages/public/ registration-list.vue')), 'registrationList')
const personInfo = r => require.ensure([], () => r(require('../pages/public/personInfo.vue')), 'personInfo')

const enterprise = r => require.ensure([], () => r(require('../pages/enterprise')), 'enterprise')
const enterpriseChildren = r => require.ensure([], () => r(require('../pages/enterprise-children/index.vue')), 'enterpriseChildren')
const enterpriseCert = r => require.ensure([], () => r(require('../pages/enterprise-children/enterprise-cert.vue')), 'enterpriseCert')
const enterpriseInfo = r => require.ensure([], () => r(require('../pages/enterprise-children/enterprise-info.vue')), 'enterpriseInfo')

const ex = r => require.ensure([], () => r(require('../pages/example')), 'ex')
const pay = r => require.ensure([], () => r(require('../pages/pay')), 'pay')
export default[
  {
    path: '/',
    name: 'index',
    component: home,
    meta:{
      showNav:true
    }
  },
  {
    path:'/pay/',
    name:'pay',
    component:pay
  },
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path: '/home/taskList/:type',
    name: 'taskList',
    props: true,
    component: homeTaskList
  },
  {
    path: '/home/taskDetail',
    name: 'taskDetail',
    component: homeTaskDeatil
  },
  {
    path: '/job',
    name: 'job',
    component: job,
    meta:{
      showNav:true
    }
  },
  {
    path: '/mine',
    name: 'mine',
    component: mine,
    meta:{
      showNav:true,
      noAuth:true
    },
  },
  {
    path:'/mine/children',
    name:'mineChildren',
    component:mineChildren,
    children:[
      {
        path:'myInfo',
        name:'myInfo',
        component:myInfo
      },
      {
        path:'userInfo',
        name:'userInfo',
        component:userInfo
      },
      {
        path:'authentication',
        name:'authentication',
        component:authentication
      },
    ]
  },
  {
    path:'/mine/info/manageMyInfo',
    name:'manageMyInfo',
    component:manageMyInfo,
    children:[
      {
        path:'workAndSkills',
        name:'workAndSkills',
        component:workAndSkills
      },
      {
        path:'addTheWork',
        name:'addTheWork',
        component:addTheWork
      },
      {
        path:'addSkills',
        name:'addSkills',
        component:addSkills
      },
      {
        path:'workExperience',
        name:'workExperience',
        component:workExperience
      },
      {
        path:'educationBackground/:edId',
        name:'educationBackground',
        component:educationBackground
      },
      {
        path:'educations',
        name:'educations',
        component:educations
      },      
      {
        path:'preferences',
        name:'preferences',
        component:preferences
      },
      {
        path:'managementWork',
        name:'managementWork',
        component:managementWork
      },
      {
        path:'managementSkills',
        name:'managementSkills',
        component:managementSkills
      },
      {
        path:'addWorkExperience/:workId',
        name:'addWorkExperience',
        component:addWorkExperience
      },
    ]
  },
  {
    path:'/enterprise',
    name: 'enterprise',
    component: enterprise,
    meta:{
      showNav:true
    },
  },
  {
    path:'/enterprise/children',
    name: 'enterpriseChildren',
    component: enterpriseChildren,
    children:[
      {
        path:'enterpriseCert',
        name:'enterpriseCert',
        component:enterpriseCert
      },{
        path:'enterpriseInfo',
        name:'enterpriseInfo',
        component:enterpriseInfo
      },

    ]
  },
  {
    path: '/release',
    name: 'release',
    component: release,
    meta:{
      showNav:true
    }
  },
  {
    path: '/message',
    name: 'message',
    component: message,
    meta:{
      showNav:true
    }
  },
  { /**消息详情 */
  path:'/messageDetails',
    name:'messageDetails',
    component:messageDetails
  },
  {
    path: '/publicChildren',
    name: 'publicChildren',
    component: publicChildren,
    children:[
      {
        path: 'feedback',
        name: 'feedback',
        component: feedback,
      },{
        path: 'historyRelease',
        name: 'historyRelease',
        component: historyRelease,
      },{
        path: 'myBill',
        name: 'myBill',
        component: myBill,
      },{
        path: 'myWallet',
        name: 'myWallet',
        component: myWallet,
      }, {
        path: 'editingTasks',
        name: 'editingTasks',
        component: editingTasks,
      },{
        path: 'registrationList',//报名列表
        name: 'registrationList',
        component: registrationList,
      }, {
        path: 'personInfo',//报名列表
        name: 'personInfo',
        component: personInfo,
      }

    ]
  },
  {
    path: '*',
    name: 'ex',
    component: ex
  }
]
